Function Wait-ScheduledTaskReady(){
    [CmdletBinding()]param(
		[Microsoft.Win32.TaskScheduler.Task]$task,
		[int]$sleep_sec=1
	)
	do{
		sleep $sleep_sec
	}while($task.state -ne "Ready")
	return $task
}
